#ifndef _START_VIEW_HPP
#define _START_VIEW_HPP 1

#include "MacMessage.hpp"
#include "HistoryDigest.hpp"

namespace BFT
{
	namespace order
	{
		namespace messages
		{
			class StartView : public BFT::messages::MacMessage
			{
				public:
				
				StartView(uint32_t _view, uint32_t _seq, 
					  boost::shared_ptr<BFT::messages::HistoryDigest> _history,
					  uint32_t _sendingReplica);
				
				StartView(boost::shared_ptr<char> _bytes, int _bytes_size);
				
				uint32_t getView(); //inlined
				
				uint32_t getSeqNo(); //inlined
				
				boost::shared_ptr<BFT::messages::HistoryDigest> getHistory(); //inlined
				
				uint32_t getSendingReplica(); //inlined
				
				protected:
				
				uint32_t viewNo;
				uint32_t seqNo;
				boost::shared_ptr<BFT::messages::HistoryDigest> history;
				
				private:
				
				static uint32_t computeSize();
			};
			
			inline uint32_t StartView::getView() {return viewNo;}
			inline uint32_t StartView::getSeqNo() {return seqNo;}
			inline uint32_t StartView::getSendingReplica() {return getSender();}
			inline boost::shared_ptr<BFT::messages::HistoryDigest> StartView::getHistory() {return history;}
			
		}
	}
}

#endif
